<template>
  <div id="app">
    <car-header></car-header>
    <goods ref="goods"
           @queryList="queryList"></goods>
    <settle ref="settle"></settle>
  </div>
</template>

<script>
import head from '@/components/header'
import goods from '@/components/goods'
import settle from '@/components/settle'
export default {
  name: 'App',
  data () {
    return {
      isGoods: false,
      isSettle: false,
      goodList: []
    }
  },
  components: {
    'car-header': head,
    goods,
    settle
  },
  created () {
    this.queryList()
  },
  methods: {
    queryList () {
      var that = this;
      this.axios.post('http://localhost:8081/goods/list', {}).then((res) => {
        console.log(res);
        that.goodList = res.data.data;
        console.log(that.$refs.goods);
        that.$refs.goods.goods = that.goodList
        that.$refs.settle.goods = that.goodList
        that.$refs.settle.getAmt()

      })
    }
  }
}
</script>

<style lang="less">
</style>
